from rest_framework import serializers
from xyz.models import Article,User


class Artsializer(serializers.ModelSerializer):
    class Meta:
        model = Article
        fields = '__all__'

class Usersializer(serializers.ModelSerializer):

    article = Artsializer(read_only=True)
    class Meta:
        model = User
        fields = '__all__'


class ArticleSerializer(serializers.ModelSerializer):
    user = Usersializer(read_only=True)
    class Meta:
        model = Article
        fields = '__all__'